//
//  Constant.swift
//  iWatchManager
//
//  Created by GujyHy on 2018/1/23.
//  Copyright © 2018年 GujyHy. All rights reserved.
//

import UIKit

class Constant {
    
    // MARK: height of  ProductsListCell
    static let labelHeight: CGFloat = 35  //
    
    static let totalItem: CGFloat = 3 // 以后要是 动态的
  
    static let column: CGFloat = 3
    
    static let minLineSpacing: CGFloat = 5.0
    static let minItemSpacing: CGFloat = 8.0
    
    static let offset: CGFloat = 8.0 // TODO: for each side, define its offset

    static func getItemWidth(boundWidth: CGFloat) -> CGFloat {
        
        // totalCellWidth = (collectionview width or tableview width) - (left offset + right offset) - (total space x space width)
        let totalWidth = boundWidth - (offset + offset) - ((column - 1) * minItemSpacing)
        
        return totalWidth / column
    }

}
